<%@ Page Language="C#" EnableViewState="false" ValidateRequest="false" AutoEventWireup="true" 
	Inherits="Syrinx.Gui.AspNet.Ajax.NitobiBasePage" MasterPageFile="~/App_ThemeMasters/NoStyle/AdminOneColumnLayout.Master" EnableEventValidation="false" %>
<%@ Register Assembly="Swaf.Gui.AspNet2" Namespace="Swaf.Gui.AspNet2" TagPrefix="swf" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet.Ajax" TagPrefix="saj" %><%@ Register Assembly="NitobiControls" Namespace="Nitobi" TagPrefix="ntb" %>
<%@ Register Assembly="ScsAspNet" Namespace="Articles.Gui.AspNet" TagPrefix="art" %>

<!--#include file="~/SiteControls/RegisterStandardControls.txt"-->
<!--#include file="../SiteControls/StandardAdminHeaderPageContent.inc"-->
<!--#include file="../SiteControls/StandardFooterPageContent.inc"-->

<script runat="server">
	public string TitleFormat = "$company.name$ - Culture & Language Management";
</script>

<asp:Content ID="c1" ContentPlaceHolderID="title" runat="server">
	<%SecurityPrivilege = "AppFunctions.ManageCompanyConfiguration"; %>
    <h1 runat="server" ID="_ImgCacheLibLbl" >Culture &amp; Language Management</h1>
    <div class="HelpBtnArea" style="float:right">
		<asp:HyperLink runat="server" ID="_pageHelp" NavigateUrl="../std/Help.aspx?helpid=CultureManagementHelp" Target="help">Help</asp:HyperLink>
	</div>
</asp:Content>

<asp:Content ID="c3" ContentPlaceHolderID="mainContent" runat="server">
<table><tr><td>
    <div class="SimpleVerticalBg">
	        <span class="button1"><saj:ActionButton runat="server" ID="_a1" Actions="tr.AddBizObj" Text="Add" /></span>
	        <span class="button1"><saj:ActionButton runat="server" ID="_a2" Actions="tr.UpdateBizObj" Text="Update" /></span>
			<span class="button1"><saj:ActionButton runat="server" ID="_a4" Actions="tr.CancelEdits" Text="Cancel" /></span>
	        <span class="button5"><saj:ActionButton runat="server" ID="_a3" Actions="tr.DeleteBizObj" Text="Delete" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>
		    <span class="button5"><saj:ActionButton runat="server" ID="_transAll" Actions="trtx.TranslateAllTexts,tr.TranslateAllArticles" Text="Translate All" ClientClick="if(!confirm('Are you sure you want to auto translate all articles to all languages?'))return false;"/></span>

            <swf:BizProc ID="tr" runat="server" FactoryName="localization">
            </swf:BizProc>
            <saj:Grid ParentBizProcIds="tr" ID="trGr" runat="server" Width="350px" Height="200px" ShowToolbar="False" Mode="LiveScrolling" >
                <Columns>
	                <ntb:KeyColumn DataField="id" />
	                <ntb:BoundColumn DataField="name" HeaderText="Name" width="100" />
	                <ntb:BoundColumn DataField="language.englishName" HeaderText="Language" width="190" />
	                <ntb:BoundColumn DataField="language.iso6392" HeaderText="ISO 639-2" width="40" />
                </Columns>
            </saj:Grid>
    </div>

	    <saj:NitobiBizObjDisplay ParentBizProcIds="tr" ID="tcd1" runat="server"
	     ReadOnlyTemplate="Localization.Gui.AspNet.TranslationDetailsDisplay" />
		<swf:BizProc runat="server" ID="gArt1" factoryName="genericArticles">
			<State id="SiteCultures" EditModeSessionKey="GlobalEdit" />
			<ParentBizProc id="loginBP"  />
		</swf:BizProc>
		<span class="button6"><saj:ActionButton runat="server" ID="_ActionButton4" Actions="gArt1.UpdateBizObj" Text="Update" /></span>
		<span class="button1"><saj:ActionButton runat="server" ID="_ActionButton7" Actions="gArt1.SetArticlePicture" Text="Set Image" ToolTip="Set primary media for this article" 
			PopupPage="SetArticleImagePopup.aspx" PopupHeight="535px" PopupWidth="800px" PopupTitle="Select a primary image for this article." /></span>

</td><td>
		<art:ArticleTranslationDisplay runat="server" ID="gd1"
			ParentBizProcIds="gArt1" 
			TranslationTemplate="Articles.Gui.AspNet.ArticleTranslationRWDisplay"
			ReadOnlyTemplate="Articles.Gui.AspNet.ArticleRODisplay$suggestedDisplayType$"
			EditableTemplate="Articles.Gui.AspNet.ArticleRWDisplay" >
		</art:ArticleTranslationDisplay>

	    <swf:BizProc ID="trtx" runat="server" FactoryName="translationTexts">
		    <ParentBizProc id="tr" fieldName="id" dataId="pid" />
	    </swf:BizProc>
        <saj:Grid ParentBizProcIds="trtx" ID="trtGr" runat="server" Width="400px" Height="600px" Mode="LiveScrolling" ShowToolbar="False" Resizable="Both" >
	        <Columns>
		        <ntb:KeyColumn DataField="textId" />
		        <ntb:BoundColumn DataField="base.text" HeaderText="Base" width="200" />
		        <ntb:TextColumn DataField="trans.text" HeaderText="Translation" width="180" ReadOnly="false" />
	        </Columns>
	    </saj:Grid>
</td></tr></table>
</asp:Content>

